<?php
class omeanalysts_mdl_ome_type extends dbeav_model{
    public function get_shop(){//店铺
        $sql = 'SELECT shop_id as type_id,name,relate_id FROM '.
            kernel::database()->prefix.'ome_shop as S LEFT JOIN '.
            kernel::database()->prefix.'omeanalysts_relate as R ON R.relate_key=S.shop_id';
        $row = $this->db->select($sql);
        return $row;
    }

    public function get_dly_corp(){//物流公司
        $sql = 'SELECT corp_id as type_id,name FROM '.kernel::database()->prefix.'ome_dly_corp';
        $row = $this->db->select($sql);
        return $row;
    }

    public function get_branch(){//仓库
		$sql = 'SELECT branch_id as type_id,name FROM '.kernel::database()->prefix.'ome_branch';
		$row = $this->db->select($sql);
		return $row;    	
    }

    public function get_schema(){
        $schema = array (
            'columns' => array (
                'order_id' => array (),
            ),
            'idColumn' => 'order_id',
        );
        return $schema;
    }
}
